home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000083_icon-group-sender _Mon Apr 5 09:23:07 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  3KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA21689
  4.     for icon-group-addresses; Mon, 5 Apr 1999 09:22:52 -0700 (MST)
  5. Message-Id: <199904051622.JAA21689@baskerville.CS.Arizona.EDU>
  6. X-Authentication-Warning: pluto.mscc.huji.ac.il: mslamm owned process doing -bs
  7. Date: Mon, 5 Apr 1999 15:13:05 +0300 (WET)
  8. From: Ehud Lamm <mslamm@mscc.huji.ac.il>
  9. To: icon-group@optima.CS.Arizona.EDU
  10. Subject: How programs fail
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13.  
  14. Had a funny problem today, which may give a lesson to us all.
  15.  
  16. I had some files that needed to be hacked a bit (a chunk was to be removed
  17. from each of them), and I decided to use Icon. 
  18.  
  19. I am using Win95, but my Icon version is quite old - 8.10 I think.
  20.  
  21. It took me a few minutes to find filter.icn in the IPL, change it to my
  22. needs and test to see it works. All was fine.
  23.  
  24. Then I tried to run it on my files, but it didn't work. No error messages,
  25. just that the output files didn't get created, and the input files, which
  26. weren't supposed to change were suddenly empty.
  27.  
  28. It occured to me that Win95 allows long file names, so I changed my
  29. directory names to one word shorter than 8 letters. However things still
  30. didn't work.
  31.  
  32. I tried moving the files arround, to my Icon direcotry, so no path will be
  33. used. No improvement. 
  34.  
  35. It tried &trace - didn't give a clue.
  36.  
  37. Only thing I found out was that the read() from the input file fails.
  38. However, I didn't see any reason for this.
  39.  
  40. I almost decided to think of another solution.
  41.  
  42. And than it hit me...
  43.  
  44. The input files were named *.htm, and I was so happy I found a way to get
  45. meaningful output names with little effort - just call them *.html. This
  46. means my code simply appended an "l".
  47.  
  48. However this made the extension longer than 3 letters... Took me an hour
  49. to notice. A minute to fix. Than it worked.
  50.  
  51. Aside from feeling stupid, I think it would have been nice if Icon would
  52. have yeeld saying that the output file name I gave it was bad. I am not
  53. sure if this can be done in any nice way, but it does show that software
  54. must be maintained, and that the dictum "if it ain't broke don't fix it"
  55. is wrong when applied to software. Other software will be upgraded and
  56. will cause yours to fail.
  57.  
  58. It is also quite sad that instead of producing an error, when the open was
  59. done - the code continued to run and corrupted the input files. Even
  60. sadder is the fact that I had no tools to help analyze the problem. My
  61. Icon version is very lacking in this regard.
  62.  
  63. I seem to recall seeing that Ralph Griswold is teaching Software Eng. Well
  64. I may use this story on my SE students...
  65.  
  66.    
  67.  
  68. Ehud Lamm     mslamm@pluto.mscc.huji.ac.il
  69.  
  70.